<template>
	<div class="app">
		<h2>我是App组件，{{msg}}</h2>
		<h3>一个大日子：{{date | fmtDate('YYYY年MM月DD日 HH:mm:ss')}}</h3>
		<h3>一个大日子：{{date | fmtDate('YYYY年MM月DD日')}}</h3>
		<h3>一个大日子：{{date | fmtDate('YYYY年MM月')}}</h3>
		<h3>一个大日子：{{date | fmtDate('YYYY年') | mySlice(4)}}</h3>
		<School/>
	</div>
</template>

<script>
	import School from './components/School'
	import dayjs from 'dayjs'

	export default {
		name:'App',
		components:{School},
		data() {
			return {
				msg:'欢迎学习Vue',
				date:1218196800000,
			}
		},
		filters:{ //局部过滤
			fmtDate(value,str){
				return dayjs(value).format(str)
			}
		}
	}
</script>

<style scoped>
	.app{
		background-color: gray;
		padding: 10px;
	}
</style>